package com.smart.cosstarter.exception;

import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;

/**
 * @Author: jj
 * @Date: 2019/8/6 16:14
 * @Version 1.0
 */
public class BaseException extends RuntimeException implements Serializable {
	private static final long serialVersionUID = 987654321L;

	public BaseException() {
	}

	public BaseException(String message) {
		super(message);
	}

	public BaseException(String message, Throwable cause) {
		super(message, cause);
	}

	public BaseException(Throwable cause) {
		super(cause);
	}

	public BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}

	public String collectExceptionStackMsg(Exception e){
		StringWriter sw = new StringWriter();
		e.printStackTrace(new PrintWriter(sw, true));
		String strs = sw.toString();
		return strs;
	}
}
